import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;

import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Main().start();
	}

	public void start() {

		String sourceName = "truc";
		String sourcePath = sourceName;
		DynamizerOld dynam = new DynamizerOld(sourcePath);
		String fileToString = dynam.fileToString();
		ArrayList<String> elements = dynam.elements(fileToString);
		System.out.println(elements);
		dynam.loadClass(elements.get(1), FileNameEnum.SIM);
		// dynam.loadData("public class truc extends ImplementMe{"
		// + "public void doSomething(){"
		// + "System.out.println(\"I do something!!!\");" + "}" + "}");
		//
		// int res = dynam.compile(sourcePath);
		// System.out.println("Compile result code = " + res);
		//
		// String className = sourceName;
		// dynam.loadClass(className);
	}

}
